<?php
namespace app\admin\model;
use think\Model;
/**
 * 模板消息
 * @package Model
 * @version 1.0
 * @author admin
 * @date 2018-3-17
 */
class MessageTpl extends BaseModel{
	
	static protected $modelObj="app\admin\model\Page";
	
	

    /**
     * 保存模板消息
     * @author billow.wang<admin@ivears.com>
     * @date 2015-05-14
     */
    public function templatesSave($id,$data){
    	$find = $this->where(array('id'=>$id))->find();
    	if($find){
			$data['update_time']=time();
			return $this->where("id",$id)->save($data);
    	}else{
			$data['create_time']=time();
			$data['update_time']=time();
			return $this->save($data);
    	}
    }	
	
	

	
	
    
}